{% extends 'blogs/base.html' %}
{% block title %}
	{{ blog.name }}
{% endblock %}
{% block blogname %}{{ blog.name }}{% endblock %}
{% block blogdesc %}{{ blog.description }}{% endblock %}
{% block append_css %}
<style type="text/css" media="screen">
	#content .content_actions {
		border: 1px solid #FFFFFF;
		border-right: none;
		margin-bottom: 20px;
		float: right;
		padding: 20px;
	}
	#content .entry {
		border: 1px solid #FFFFFF;
		border-left: none;
		width: 60%;
		margin-bottom: 20px;
	}
	#content .entry h2 {
		color: #8C0A89;
		margin-left: 0px;
	}
	#content .entry h2 span {
		border: 1px solid #FFFFFF;
		border-left: none;
		padding-left: 20px;
		padding-right: 20px;
	}
	#content .entry .meta {
		font-size: small;
		color: #444444;
		text-align: center;
	}
	#content .entry p {
		padding: 10px;
	}
	.content .no_entry {
		height: 270px;
		font-size: large;
		padding: 50px;
	}
</style>

{% endblock %}
{% block content %}
	<div class="content">
		<div class="content_actions">
			<a class="new_entry" href="post/">Post a new entry</a>  
		</div>
	{% if entries %}
		{% for entry in entries %}
		<div class="entry">
			<h2><span>{{ entry.title }}</span></h2>
			<div class="entry_actions">
				<ul>
					<li><a href="entry/{{ entry.id }}/">full text</a></li>	
					<li><a href="entry/{{ entry.id }}/comment/">comment it</a></li>
				{% ifequal user.username blog.owner.username %}
					<li><a href="edit/{{ entry.id }}">edit</a></li>
					<li><a href="delete/{{ entry.id }}">delete</a></li> 
				{% endifequal %}
				</ul>
			</div>
			<p class="meta">update time: {{ entry.datetime }}
            , written by: {{ entry.blog.owner.username }}, 
            comments {{ entry.comment_set.count }}</p>
			<p>{{ entry.text|truncatewords:50 }}</p>
		</div>
		{% endfor %}
	{% else %}
		<p class="no_entry">There is no entry yet</p>
	{% endif %}
	</div>
{% endblock %}
